home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
comm
/
bbs
/
dat_h15e.lha
/
HydraBBSA15_Part_e.lha
/
HBBS
/
Developer
/
CodingTips.TXT
next >
Wrap
Text File
|
1997-08-22
|
2KB
|
42 lines
Right then, here's a couple of tips for all you door coders out there...
1) to make text output faster, call DOOR_WriteText() as little times as possible
e.g. say you were writing your help for a door to the screen and you were doing
it like this...
DOOR_WriteText("This is a cool door\r\n");
DOOR_WriteText("and here is some \r\n");
DOOR_WriteText("rather cool help text\r\n");
DOOR_WriteText("hope you like it!\r\n");
DON'T, do it like THIS instead..
DOOR_WriteText("This is a cool door\r\n"
"and here is some \r\n"
"rather cool help text\r\n"
"hope you like it!\r\n");
the above examples BOTH do the same thing, but the second example is better
because a) code size is smaller b) execution time is faster and c) screen
output is faster!
2) code routines that are called lots of times in ASM...
(but comment well so you can convert it to PowerPC code next year! heh)
3) load your doors own private config files from "ProgDir:MyConfig.CFG" rather
than specifying an absolute path like "HBBS:Doors/MyDoor/MyConfig.CFG"
this makes it easier for systems to move files where they like..
(you can also get the name of the directory that your program was run from
by getting argv[0] and turning the last / into a NULL
e.g. argv[0]="MyHD:hbbs/doors/mydirectory/myfile.hbbs"
^ change this to a 0....
4) Have a look at the source code files HBBSCommon.c and HBBSNode.C to see
what cool library functions you can use, and ther are loads!!!